import App from './App'

import { createSSRApp } from 'vue'
import uvUI from '@/uni_modules/uv-ui-tools'

import * as Pinia from 'pinia'
import piniaPersist from 'pinia-plugin-persist'
import whUtils from '@/utils/wh.utils.js'
import cfg from '@/cfg.js'

// 开发调试时使用正式环境注释掉该处即可
// import vConsole from '@/utils/wh.vconsole.js'
// import "@/mock"; 

export function createApp() {
  const app = createSSRApp(App)
  const pinia = Pinia.createPinia().use(piniaPersist)
  app.config.globalProperties.CFG = cfg;
  
  app.use(pinia)
  app.use(uvUI);
  
  app.config.globalProperties.$wh= whUtils; // 全局挂载whUtils对象，以便在组件中使用$w.xxx调用方法或属性。
  return {
    app,
	Pinia
  }
}
